<!DOCTYPE html>
        <html lang="zh-cn">
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <meta name="description" content="">
            <meta name="author" content="">
            <link rel="icon" href="../../favicon.ico">

            <title>Off Canvas Template for Bootstrap</title>

            <!-- Bootstrap core CSS -->
            <link href="assets/css/bootstrap.min.css" rel="stylesheet">

            <!-- Custom styles for this template -->
            <link href="assets/css/offcanvas.css" rel="stylesheet">
            <link href="assets/css/style.css" rel="stylesheet">
            <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
            <!--[if lt IE 9]>
            <script src="assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
            <script src="assets/js/ie-emulation-modes-warning.js"></script>

            <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
            <!--[if lt IE 9]>
            <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
            <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
            <![endif]-->
        </head>

        <body>
        <nav class="navbar navbar-fixed-top navbar-inverse">
          <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
              <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
             
            </div>
            <?php 
               require_once('inc_admin.php'); 
           // require_once('system/dbConn.php');
            connect();
            $sql='select* from videotype ';
            $rs=mysql_query($sql)or die('查询1失败！'.mysql_error());
         ?>
         <ul class="nav navbar-nav">
          <li><a href="index.php">首页</a></li>
          <?php 
                while($row=mysql_fetch_assoc($rs))
                {
           ?>
             <li>
                 <a href="list.php?tid=<?php
                 echo $row["tid"];?>
                 "><?php 
                 echo $row["typename"];
                  ?>
                 </a></li>
                 <?php } ?>
         </ul>

          
            
              <form class="navbar-form navbar-left" role="search" action="search.php">
                <div class="form-group">
                  <input type="text" class="form-control" placeholder="Search" name="videoname">
                </div>
                <button type="submit" class="btn btn-default">搜索</button>
              </form>
              <ul class="nav navbar-nav navbar-right">
              <li class="active"> <a href="">欢迎 <?php 
              session_start();
              if (isset($_SESSION["user"]))
                echo "  ".$_SESSION["user"]."";
            else{
                echo"您";
            }
               ?> 访问本网站</a></li>
               <?php 
               if(isset($_SESSION["user"]))
               {
                 ?>
                 <li><a href="logout.php">注销</a></li>
                   <li class="dropdown">
                       <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button"
                       aria-haspopup="true" aria-expanded="false">个人中心<span class="caret"></span></a>
                       <ul class="dropdown-menu">
                        <li><a href="#" data-toggle="modal" data-target="#changePassword">修改个人密码</a></li>
                        <li><a href="#" data-toggle="modal" data-target="#changeInfor">修改个人信息</a></li>   
                       <li><a href="myCommentList.php">我的评价</a></li>
                       </ul>
                   </li> 
                   <?php 
                   }else{ 
                    ?>   
                <li><a href="#" data-toggle="modal" data-target="#login">登录</a></li>
                <li><a href="#" data-toggle="modal" data-target="#reg">注册</a></li>
             <?php 
             } 
             ?>
    





         </ul>
          </div>
         </div>
         </nav>
          <!-- **************** -->
<?php  
       header("Content-type:text/html;charset=utf-8");
      require_once('./system/dbConn.php');
      connect();
  session_start();
    $u=$_SESSION["user"];
    $sql="select * from users where uname='$u' ";
    $resul=mysql_query($sql) or die('查询失败！'.mysql_error());
    $ro=mysql_fetch_assoc($resul);
    $uid=$ro["uid"];
    $sql="select * from comments where uid='$uid'";
    //echo $sql.'<br/>';
    $result=mysql_query($sql);
    $totalrows=mysql_num_rows($result);
    //获取指定的页码
    $page=$_REQUEST['page'];
    if(!isset($page))
        $page=1;
    //定义每页显示的行数
    $rowsperpage=2;
    //计算从表第几行开始输出
    $start=($page-1)*$rowsperpage;
    $sql.="limit {$start},{$rowsperpage}";
    $result=mysql_query($sql) or die('查询失败！'.mysql_error());
        if($totalrows)
          { echo  '<div class="container-fluid control-label col-md-12 "><h1 class="text-center">留言列表</h1>
     <table class="table  table-bordered">
     <tr class="info">
         <th>序号</th>
         <th>评价内容</th>
         <th>发表时间</th>
         <th>视频名称</th>
         <th>操作</th>
     </tr> ';
          while($row=mysql_fetch_assoc($result))
        {
            echo '<tr class="success">';
            foreach ($row as $k => $value)
            {
                if($k=='uid')
                
                    continue; 
                elseif($k=='vid')
                {
                    $sql2='select * from videos where vid="'.$value.'"';
                    $result2=mysql_query($sql2);
                    while($row2=mysql_fetch_assoc($result2))
                    {foreach ($row2 as $ke => $value2)
                    if($ke=='videoname')
                        $value=$value2;}
                }

                echo '<td>'.$value.'</td>';
            }
            echo '<td><a href="myCommentEditForm.php?id='.$row['cid'].'">修改|</a><a href="myCommentDelete.php?id='.$row['cid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
            echo '</tr>';
        }
        echo '</table>';
        //计算总页数。如果煤业显示的行数>总行数，则只有一页，否则页数=总行数/每页行数，上取整。
        if($rowsperpage>=$totalrows)
            $totalpages=1;
        else
            $totalpages=ceil($totalrows/$rowsperpage);
        echo '<nav><ul class="pager">';

        if($page==1)
            {
                echo '<li class="previous disabled"><a href="#">'.'首页'.'</a></li>';
                echo '<li class="previous disabled"><a href="#">'.'上一页'.'</a></li>';
            }
        else
        {
            echo '<li class="previous"><a href="?page=1&key='.$key.'">'.'首页'.'</a></li>';
            echo '<li class="previous"><a href="?page='.($page-1).'&key='.$key.'">'.'上一页'.'</a></li>';
        }
        for($i=1;$i<=$totalpages;$i++)
            echo '<li class="active"><a href="?page='.$i.'&key='.$key.'">'.$i.'</a></li>';
        if($page>=$totalpages)
        {
                echo '<li class="next disabled"><a href="#">'.'尾页'.'</a></li>';
                echo '<li class="next disabled"><a href="#">'.'下一页'.'</a></li>';
        }
        else
        {
            echo '<li class="next"><a href="?page='.$totalpages.'&key='.$key.'">'.'尾页'.'</a></li>';
            echo '<li class="next"><a href="?page='.($page+1).'&key='.$key.'">'.'下一页'.'</a></li>';
        }
        echo '</ul></nav>';
        echo "<font color=red align=right >";
        echo "<h5>共{$totalrows}条记录</h5>";
        echo "</font>";
        //输出第几页/共几页
        echo "<font color=green align=right >";
        echo "<h5>第".$page."页/共".$totalpages."页</h5>";
        echo "</font>";
        //输出转到胡特的表单
         
        echo '<form method=post method="myCommentList.php" enctype="multipart/form-data" class="form-horizontal">
            <div align="right" class="form-group">
                <div class="col-md-offset-11 col-md-1">
                    <input  type="text" name="page" class="form-control"></div>
                <input type="submit" class="btn btn-success btn-xs" value="转到">
            </div>
        </form>';
         }


         else
          
            echo  '<h3 align="center" style="color:red;">您尚未评价任何影片，找不到您的评论记录</h3><hr>';
         ?>
        </div>


     <!-- ************* --> 

<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="assets/js/ie10-viewport-bug-workaround.js"></script>

<script src="offcanvas.js"></script>
<script>
    $('.carousel').carousel({
        interval: 3000 //changes the speed
    })
</script>
</body>
</html>


     <!-- ***************** -->